import { createApp } from 'vue';
// global css
import 'virtual:uno.css';
import '@/assets/styles/index.scss';
import 'element-plus/theme-chalk/dark/css-vars.css';

// App、router、store
import App from './App.vue';
import store from './store';
import router from './router';

// 自定义指令
import directive from './directive';

// 注册插件
import plugins from './plugins/index'; // plugins

// 高亮组件
// import 'highlight.js/styles/a11y-light.css';
import 'highlight.js/styles/atom-one-dark.css';
import 'highlight.js/lib/common';
import HighLight from '@highlightjs/vue-plugin';

// svg图标
import 'virtual:svg-icons-register';
import ElementIcons from '@/plugins/svgicon';

// permission control
import './permission';

// 国际化
import i18n from '@/lang/index';

// vxeTable
import VXETable from 'vxe-table';
import VxeUITable, { VxeUI } from 'vxe-table'
import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element'

// 引入阿里云图标库 Symbol
import './assets/iconfont/iconfont.js'
// 引入自定义图标组件
import IconFont from './components/IconFont/index.vue'

import 'vxe-table/lib/style.css';
import '@vxe-ui/plugin-render-element/dist/style.css'

VXETable.setConfig({
  zIndex: 999999
});

// 修改 el-dialog 默认点击遮照为不关闭
import { ElDialog } from 'element-plus';
ElDialog.props.closeOnClickModal.default = false;

/**
 * 引入富文本ueditor
 */
import VueUeditorWrap from 'vue-ueditor-wrap';
import { ElInput, ElInputNumber, ElSelect, ElCascader, ElDatePicker, ElTimeSelect,ElOption } from 'element-plus'

const app = createApp(App);

VxeUIPluginRenderElement.component(ElInput)
VxeUIPluginRenderElement.component(ElInputNumber)
VxeUIPluginRenderElement.component(ElSelect)
VxeUIPluginRenderElement.component(ElCascader)
VxeUIPluginRenderElement.component(ElDatePicker)
VxeUIPluginRenderElement.component(ElTimeSelect)
VxeUIPluginRenderElement.component(ElOption)

VxeUI.use(VxeUIPluginRenderElement);
app.component('iconfont', IconFont);
app.use(HighLight);
app.use(ElementIcons);
app.use(router);
app.use(store);
app.use(i18n);
app.use(VXETable);
app.use(VxeUITable);
app.use(plugins);
app.use(VueUeditorWrap);
// 自定义指令
directive(app);

app.mount('#app');
